package run.vueblog.app.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import run.vueblog.app.common.lang.Result;
import run.vueblog.app.entity.User;
import run.vueblog.app.service.UserService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhanghuan
 * @since 2020-08-05
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    /*
    @GetMapping("/index")
    public Object index(){
        return userService.getById(1L);
    }
    */
    @GetMapping("/index")
    public Object index() {
        User user = userService.getById(1L);
//        return Result.success(200,"获取成功",user);
        return Result.success(user);
    }

}
